Is there a good reference to use to understand all the arguments for olePut, oleGet, oleMethod, etc.? I am trying to write a pretty simple script to print a log of what was done in dxl to a word document or a text file(but that seems more difficult) and between the forums, the reference manual, and browsing the web I still don't have the understanding I would like to have. I am using DOORS 9.3. |
Re: Ole Objects and writing to Microsoft Word example and explanation Also, read up on Visual Basic for Applications, particularly the Word object model. If you don't know VBA, you're not going to get anywhere in OLE Automation for Word. If you can write to a text file instead, it's WAY easier to do that, not harder. Look up Streams in the DXL reference manual. |
Re: Ole Objects and writing to Microsoft Word example and explanation
Reading the MSN web site [http://msdn.microsoft.com/en-us/library/bb214334(v=office.12).aspx] I see the important part of these top lines:
Is that it deals with CanvasShapes. Your code would then look like this:
I see for Word I've need to be very persnikety with nuance differences between "Application", "Documents", "Document", and "Selection" Objects. My variable names therefore have "App", "Docs", "Doc", or "Sel" respectively in their names. -Louie |
Re: Ole Objects and writing to Microsoft Word example and explanation
Hi
bool checkOleErrorString(string sErrorString) {
if (sErrorString == null) { return(false) };
logError(sErrorString dxlHere());
return true;
}
Inside your "vba script code" you can use: checkOleErrorString(oleGet/Put/Method(...));
if checkOleErrorString(oleGet/Put/Method(...)) {
// troubleshooting code
}
// standard code
Best regards
|
Re: Ole Objects and writing to Microsoft Word example and explanation kbmurphy - Thu Mar 07 14:07:27 EST 2013 Any advice on how to create a .txt file in the dxl script? I see how to stream write to an already existing file but I am not sure how to create and open one for writing in dxl ---------------------{Code}------------------------------- //stream to .txt file //name for the .txt file //get the date and time of the log Date logDate = dateAndTime(today) string logDateString = stringOf(logDate) string outputFID = "Target Module Update Log "logDateString //create the .txt file //??? not sure how to do so in dxl ??? //write the results log to the .txt file Stream logStream = write(string outputFID) ---------------------{End Code}------------------------------- Thanks in advance, rb24 |
Re: Ole Objects and writing to Microsoft Word example and explanation SystemAdmin - Fri Mar 08 12:05:28 EST 2013
Off the top of my head:
Date logDate = dateAndTime(today)
string logDateString = stringOf(logDate)
string outputFID = "Target Module Update Log " logDateString
//create the .txt file
Steam logStream = write("c:/temp/" outputFID)
//??? not sure how to do so in dxl ???
outputFID << "This is the first line of the log file.\n"
outputFID << "This is the second line of the log file.\n"
close logStream
|
Re: Ole Objects and writing to Microsoft Word example and explanation kbmurphy - Fri Mar 08 13:39:38 EST 2013
Off the top of my head:
Date logDate = dateAndTime(today)
string logDateString = stringOf(logDate)
string outputFID = "Target Module Update Log " logDateString
//create the .txt file
Steam logStream = write("c:/temp/" outputFID)
//??? not sure how to do so in dxl ???
outputFID << "This is the first line of the log file.\n"
outputFID << "This is the second line of the log file.\n"
close logStream
|
Re: Ole Objects and writing to Microsoft Word example and explanation kbmurphy - Fri Mar 08 13:39:38 EST 2013
Off the top of my head:
Date logDate = dateAndTime(today)
string logDateString = stringOf(logDate)
string outputFID = "Target Module Update Log " logDateString
//create the .txt file
Steam logStream = write("c:/temp/" outputFID)
//??? not sure how to do so in dxl ???
outputFID << "This is the first line of the log file.\n"
outputFID << "This is the second line of the log file.\n"
close logStream
Hi,
string sTemp = getenv("temp")
|